<!--执行反馈-->
<div class="rightDiv" [hidden]="pageIndex != 1">
  <div class="exciseTableDiv" *ngIf="!isFeedback && !feedbackResult">
    <div>
      <label nz-radio-button style="border-right: 0;cursor: default" class="nocourse"><span>反馈状态</span></label>
      <nz-radio-group [(ngModel)]="tabType" [nzButtonStyle]="'solid'" (ngModelChange)="tabsChange($event)">
        <label nz-radio-button [nzValue]="'all'" style="border-radius: 0"><span>全部</span></label>
        <label nz-radio-button [nzValue]="0"><span>待反馈</span></label>
        <label nz-radio-button [nzValue]="5"><span>审核中</span></label>
        <label nz-radio-button [nzValue]="15"><span>未通过</span></label>
        <label nz-radio-button [nzValue]="10"><span>已反馈</span></label>
      </nz-radio-group>
    </div>
    <div style="margin-top: 15px">
      <div class="searchDiv text-right" style="margin-bottom: 15px">
        <label>
          <span>文件号：</span>
          <input nz-input placeholder="请输入" [(ngModel)]="searchObj.number"/>
        </label>
        <label>
          <span>制度名称：</span>
          <input nz-input placeholder="请输入" [(ngModel)]="searchObj.name"/>
        </label>
        <label>
          <span>作用对象：</span>
          <nz-select nzPlaceHolder="请选择" [(ngModel)]="searchObj.actionTarget">
            <nz-option *ngFor="let option of zydxList;" [nzValue]="option.text" [nzLabel]="option.text"></nz-option>
          </nz-select>
        </label>
        <label>
          <span>发布人：</span>
          <input nz-input placeholder="请输入" [(ngModel)]="searchObj.publisherName"/>
        </label>
        <label>
          <span>发布部门：</span>
          <input nz-input placeholder="请输入" [(ngModel)]="searchObj.deptName"/>
        </label>
        <label style="margin-right: 0">
          <button nz-button style="margin-right:10px" nzType="primary" (click)="clickSearch()">查询</button>
          <button nz-button nzType="default" (click)="resetSearch()">重置</button>
        </label>
      </div>
      <div>
        <ng-template #totalTemplate let-total>总共 {{ pageInfo.totalRecords? pageInfo.totalRecords:0 }} 条</ng-template>
        <nz-table
          #exciseBankTable
          nzBordered
          [nzData]="allList"
          [nzFrontPagination]="false"
          [nzShowPagination]="true"
          [nzPageIndex]="pageInfo.first"
          [nzTotal]="pageInfo.totalRecords"
          [nzShowTotal]="totalTemplate"
          [nzPageSize]="pageInfo.rows"
          [nzLoadingDelay]="1"
          [nzPageSizeOptions]="[10,20,30,50,100]"
          [nzShowQuickJumper]="true"
          [nzShowSizeChanger]="true"
          (nzPageIndexChange)="searchPageIndex($event)"
          (nzPageSizeChange)="searchPageSize($event)"
          [nzWidthConfig]="widthConfigs"
          [nzScroll]="{x: '2170px'}"
        >
          <thead>
          <tr>
            <th nzLeft="0px">序号</th>
            <th>文件号</th>
            <th>制度名称</th>
            <th>制度类型</th>
            <th>执行部门</th>
            <th>作用对象</th>
            <th>制度状态</th>
            <th>制度生效日期</th>
            <th>发布人</th>
            <th>发布部门</th>
            <th>发布日期</th>
            <th>反馈状态</th>
            <th>驳回理由</th>
            <th nzRight="0px">操作</th>
          </tr>
          </thead>
          <tbody>
          <tr *ngFor="let item of exciseBankTable.data;let i = index;">
            <td nzLeft="0px">{{ i + 1 }}</td>
            <td>{{item.number}}</td>
            <td>{{item.name}}</td>
            <td>{{item.caseType}}</td>
            <td>{{item.deptNameStr}}</td>
            <td>{{item.actionTarget}}</td>
            <td>{{stateObj[item.state]}}</td>
            <td>{{item.effectiveDate | date: 'yyyy-MM-dd'}}</td>
            <td>{{item.publisherName}}</td>
            <td>{{item.publishDeptName}}</td>
            <td>{{item.publishDate}}</td>
            <td>
              <span *ngIf="item.feedbackState == 0">待反馈</span>
              <span *ngIf="item.feedbackState == 5">审核中</span>
              <span *ngIf="item.feedbackState == 15" style="color: #FF4338">未通过</span>
              <span *ngIf="item.feedbackState == 10">已反馈</span>
            </td>
            <td>{{item.checkContent}}</td>
            <td nzRight="0px">
              <span class="operaFont m-r-sm" (click)="look(item)">查看</span>
              <span class="operaFont m-r-sm" (click)="downFj(item)">下载</span>
              <span class="operaTao" (click)="toFeedBack(item)" *ngIf="item.feedbackState != 5">执行反馈</span>
              <span class="operaTao" (click)="returnFeedBack(item)" *ngIf="item.feedbackState == 5">反馈结果</span>
            </td>
          </tr>
          </tbody>
        </nz-table>
      </div>
    </div>
  </div>

  <!--执行反馈-->
  <div class="exciseTableDiv" *ngIf="isFeedback">
    <div style="height: 50px;font-size: 16px">
      <span>执行反馈</span>
      <span class="fl-r operaFont" (click)="isFeedback = false;">
        返回上一级<i class="fa fa-reply m-l-sm"></i>
      </span>
    </div>
    <div class="formdiv">
      <form nz-form [formGroup]="validateForm">
        <div nz-row>
          <div nz-col nzSpan="12">
            <nz-form-item>
              <nz-form-label [nzSm]="6">
                文件号
              </nz-form-label>
              <nz-form-control [nzSm]="18" [nzXs]="10">
                {{currObj?.number}}
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col nzSpan="12">
            <nz-form-item>
              <nz-form-label [nzSm]="6">
                制度名称
              </nz-form-label>
              <nz-form-control [nzSm]="18" [nzXs]="10">
                {{currObj?.name}}
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row>
          <div nz-col nzSpan="12">
            <nz-form-item>
              <nz-form-label [nzSm]="6" nzRequired>
                是否执行
              </nz-form-label>
              <nz-form-control [nzSm]="18" [nzXs]="10">
                <nz-radio-group [(ngModel)]="feedback.isExecute" formControlName="isExecute">
                  <label nz-radio nzValue="1">是</label>
                  <label nz-radio nzValue="0">否</label>
                </nz-radio-group>
                <nz-form-explain
                  *ngIf="validateForm.get('isExecute').dirty && validateForm.get('isExecute').errors">
                  <span [hidden]="!validateForm.hasError('required','isExecute')">是否执行不能为空</span>
                </nz-form-explain>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>

        <div nz-row>
          <div nz-col nzSpan="24">
            <nz-form-item>
              <nz-form-label [nzSm]="3" nzRequired>
                {{feedback?.isExecute == 0?'备注原因':'执行情况记录'}}
              </nz-form-label>
              <nz-form-control [nzSm]="21" [nzXs]="15">
                <textarea rows="4" nz-input [(ngModel)]="feedback.content" style="width: 100%" maxlength="200" formControlName="content"></textarea>
                <nz-form-explain
                  *ngIf="validateForm.get('content').dirty && validateForm.get('content').errors">
                  <span [hidden]="!validateForm.hasError('required','content')">{{feedback?.isExecute == 0?'备注原因':'执行情况记录'}}不能为空</span>
                </nz-form-explain>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>

        <div nz-row>
          <div nz-col nzSpan="24">
            <nz-form-item>
              <nz-form-label [nzSm]="3" nzRequired>
                审批人
              </nz-form-label>
              <nz-form-control [nzSm]="21" [nzXs]="15">
                <nz-select [(ngModel)]="feedback.checkerId" nzShowSearch nzPlaceHolder="请选择" style="width: 100%" (ngModelChange)="checkChange($event)" formControlName="checkerId">
                  <nz-option *ngFor="let item of teacherList" [nzValue]="item.id" [nzLabel]="item.name + ' ' + item.number + ' ' + item.orgName"></nz-option>
                </nz-select>
                <nz-form-explain
                  *ngIf="validateForm.get('checkerId').dirty && validateForm.get('checkerId').errors">
                  <span [hidden]="!validateForm.hasError('required','checkerId')">审批人不能为空</span>
                </nz-form-explain>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>

        <div nz-row>
          <div nz-col nzSpan="24">
            <div style="text-align: center;margin-top: 30px">
              <button nz-button nzType="default" (click)="isFeedback = false;" style="margin-right:10px;">取消</button>
              <button nz-button nzType="primary" (click)="saveFeedback()" [disabled]="!validateForm.valid">确定</button>
            </div>
          </div>
        </div>
      </form>

    </div>

  </div>

  <!--反馈结果-->
  <div class="exciseTableDiv" *ngIf="feedbackResult">
    <div style="height: 50px;font-size: 16px">
      <span>反馈结果</span>
      <span class="fl-r operaFont" (click)="feedbackResult = false;">
        返回上一级<i class="fa fa-reply m-l-sm"></i>
      </span>
    </div>
    <div class="formdiv">
      <div nz-row>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="6">
              文件号
            </nz-form-label>
            <nz-form-control [nzSm]="18" [nzXs]="10">
              {{currObj?.number}}
            </nz-form-control>
          </nz-form-item>
        </div>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="6">
              制度名称
            </nz-form-label>
            <nz-form-control [nzSm]="18" [nzXs]="10">
              {{currObj?.name}}
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

      <div nz-row>
        <div nz-col nzSpan="12">
          <nz-form-item>
            <nz-form-label [nzSm]="6" nzRequired>
              是否执行
            </nz-form-label>
            <nz-form-control [nzSm]="18" [nzXs]="10">
              <nz-radio-group [(ngModel)]="feedbackResultParam.isExecute" disabled>
                <label nz-radio [nzValue]="1">是</label>
                <label nz-radio [nzValue]="0">否</label>
              </nz-radio-group>
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

      <div nz-row>
        <div nz-col nzSpan="24">
          <nz-form-item>
            <nz-form-label [nzSm]="3" nzRequired>
              {{feedbackResultParam.isExecute == 0?'备注原因':'执行情况记录'}}
            </nz-form-label>
            <nz-form-control [nzSm]="21" [nzXs]="15">
              <span>{{feedbackResultParam.content}}</span>
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

      <div nz-row>
        <div nz-col nzSpan="24">
          <nz-form-item>
            <nz-form-label [nzSm]="3" nzRequired>
              审批流程
            </nz-form-label>
            <nz-form-control [nzSm]="21" [nzXs]="15">
              <span class="m-r-lm">{{feedbackResultParam.checkerName}}</span>
              <span>审核中</span>
            </nz-form-control>
          </nz-form-item>
        </div>
      </div>

    </div>

  </div>
</div>

<app-system-form *ngIf="pageIndex == 2" [currObj]="currObj" [opreatType]="2" (backemit)="backthis($event)"></app-system-form>
